package com.itheima.testDemo;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.xssf.usermodel.XSSFSheet;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.junit.Test;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

import java.io.IOException;

public class Demo1 {
//    @Test
    public void test1() throws IOException {
        XSSFWorkbook workbook = new XSSFWorkbook("D:/hello.xlsx");
        XSSFSheet sheet1 = workbook.getSheetAt(1);
        for (Row row : sheet1) {
            for (Cell cell : row) {
                cell.setCellType(Cell.CELL_TYPE_STRING);
                String stringCellValue = cell.getStringCellValue();
                System.out.print(stringCellValue +"  ");
            }
            System.out.println();
        }

    }

    @Test
    public void test02() {
        BCryptPasswordEncoder bCryptPasswordEncoder = new BCryptPasswordEncoder();
        String encode = bCryptPasswordEncoder.encode("admin");
        System.out.println("encode = " + encode);
        boolean admin = bCryptPasswordEncoder.matches("admin", encode);
        System.out.println("admin = " + admin);

    }


}
